package fun.qu_an.minecraft.fabric.fzbbl.mixin;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.At;

import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.scoreboard.ScoreboardObjective;
import fun.qu_an.minecraft.fabric.fzbbl.event.ScoreboardEvents;

@Mixin(Scoreboard.class)
public class ScoreboardRemovedMixin {
    @Inject(at = @At(value = "RETURN"), method = "removeObjective")
    public void onScoreboardRemoved(final ScoreboardObjective objective, CallbackInfo ci) {
        ScoreboardEvents.REMOVED.invoker().interact(objective);
    }
}
